import Vue from "vue";
import Vuex from "vuex";
import persist from "vuex-persist";
Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    history: [],
  },
  mutations: {
    add(state, val) {
      state.history.unshift(val);
    },
  },
  actions: {},
  modules: {},
  getters: {},
  plugins: [
    new persist({
      storage: window.localStorage,
    }).plugin,
  ],
});
